home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Oct 20, 1998
- // Author: mt
- //
- // Description:
- // This script is the option box dialog for setting keyframes on characters.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
-
- proc setOptionVars (int $forceFactorySettings)
- {
- if( $forceFactorySettings || !`optionVar -exists setKeyframePrompt` ) {
- optionVar -intValue setKeyframePrompt 0;
- }
- }
-
- global proc setKeyframeCharacterSetup (string $parent, int $forceFactorySettings)
- {
- // Retrieve the option settings
- //
- setOptionVars( $forceFactorySettings );
-
- setParent $parent;
-
- if( `optionVar -query setKeyframePrompt` == 1 ) {
- radioButtonGrp -e -select 2 setKeyframePrompt;
- } else {
- radioButtonGrp -e -select 1 setKeyframePrompt;
- }
- }
-
- global proc setKeyframeCharacterCallback (string $parent, int $doIt)
- //
- // Description:
- // Set the optionVar's from the control values, and then perform
- // the command
- //
- {
- setParent $parent;
-
- if (`radioButtonGrp -query -select setKeyframePrompt` == 2) {
- optionVar -intValue setKeyframePrompt 1;
- } else {
- optionVar -intValue setKeyframePrompt 0;
- }
-
- if ($doIt)
- {
- performSetKeyframeCharacter false;
- }
- }
-
-
-
- proc string setKeyframeCharacterWidgets( string $parent )
- {
- setParent $parent;
-
- string $tabForm = `columnLayout -adjustableColumn true`;
-
- radioButtonGrp -numberOfRadioButtons 2
- -label "Set Keys at"
- -label1 "Current Time"
- -label2 "Prompt"
- setKeyframePrompt;
-
- return $tabForm;
- }
-
- global proc setKeyframeCharacterOptions ()
- {
- string $commandName = "setKeyframeCharacter";
-
- string $applyTitle = "Set Key";
-
- // Build the option box "methods"
- //
- string $callback = ($commandName + "Callback");
- string $setup = ($commandName + "Setup");
-
- // Get the option box.
- //
- // The value returned is the name of the layout to be used as
- // the parent for the option box UI.
- //
- string $layout = getOptionBox();
- setParent $layout;
-
- setOptionBoxCommandName($commandName);
-
- setUITemplate -pushTemplate DefaultTemplate;
- waitCursor -state 1;
- tabLayout -scr true -tv false; // To get the scroll bars
-
- string $parent = `columnLayout -adjustableColumn 1`;
-
- setKeyframeCharacterWidgets $parent;
-
- waitCursor -state 0;
- setUITemplate -popTemplate;
-
- // 'Apply' button.
- //
- string $applyBtn = getOptionBoxApplyBtn();
- button -edit
- -label $applyTitle
- -command ($callback + " " + $parent + " " + 1)
- $applyBtn;
- dimWhen -false "SomethingSelected" $applyBtn;
-
- // 'Save' button.
- //
- string $saveBtn = getOptionBoxSaveBtn();
- button -edit
- -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
- $saveBtn;
-
- // 'Reset' button.
- //
- string $resetBtn = getOptionBoxResetBtn();
- button -edit
- -command ($setup + " " + $parent + " " + 1)
- $resetBtn;
-
- // Set the option box title.
- //
- setOptionBoxTitle("Set Character Key Options");
-
- // Set the current values of the option box.
- //
- eval (($setup + " " + $parent + " " + 0));
-
- // Show the option box.
- //
- showOptionBox();
- }
-
-
- //
- // Procedure Name:
- // assembleCmd
- //
- // Description:
- // Construct the command that will apply the option box values.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
- proc string assembleCmd()
- {
- string $cmd;
- int $breakdown = 0;
-
- setOptionVars(false);
-
- // doSetKeyframeCharacterArgList takes a string array
- //
- string $cmd = "doSetKeyframeCharacterArgList 1 { " +
- "\"" + `optionVar -query setKeyframePrompt` + "\"" +
- ",\"" + $breakdown + "\"" +
- " };";
-
- return $cmd;
- }
-
- //
- // Procedure Name:
- // performSetKeyframeCharacter
- //
- // Description:
- // Perform the 'setKeyframe' command on the current characters
- // using the corresponding option values. This procedure will
- // also show the option box window if necessary as well as
- // construct the command string that will invoke the 'setKeyframe'
- // command with the current option box values.
- //
- // Input Arguments:
- // 0 - Execute the command.
- // 1 - Show the option box dialog.
- // 2 - Return the command.
- //
- // Return Value:
- // None.
- //
- global proc string
- performSetKeyframeCharacter (int $action)
- {
- string $cmd = "";
-
- switch ($action) {
-
- // Execute the command.
- //
- case 0:
- // Retrieve the option settings
- //
- setOptionVars(false);
-
- // Get the command.
- //
- $cmd = `assembleCmd`;
-
- // Execute the command with the option settings.
- //
- eval($cmd);
-
- break;
-
- // Show the option box.
- //
- case 1:
- setKeyframeCharacterOptions;
- break;
- }
- return $cmd;
- }
-